package com.bobo.mm.dogs;

import android.content.Context;
import android.os.Build;
import android.util.Log;

/**
 * 二哈憨逼，傻傻的定时看门
 * Created by cocolove2 on 2020/6/18.
 */
public class ErhaDog extends DogFather {
    private static final String TAG = "ErhaDog";
    private static final int CODE_ID = 0x4;
    private static final int LOOK_DURATION = 60 * 1000;//心跳周期
    private int mDuration = LOOK_DURATION;

    public ErhaDog(Context context) {
        super(context);
        setMaxCountEndure(3);
        setPingCount(0);
    }

    public ErhaDog(Context context, int maxCount, int duration) {
        super(context);
        setMaxCountEndure(maxCount);
        setPingCount(0);
        mDuration = duration;
    }

    @Override
    public void doForaging() {
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
            Log.e(TAG, "本二哈最低支持版本为5.1，以下概不伺候！！！");
            return;
        }
        super.doForaging();
        buildDogJob(mDuration);
    }

    @Override
    protected int getDogId() {
        return CODE_ID;
    }
}
